Skip to content

fix(ui): hide only the top bar on tablet/desktop scroll, keep search#1238

Merged
BigSimmo merged 22 commits into
mainfrom
cursor/header-hide-top-bar-only-4fd7
Jul 25, 2026
Merged

fix(ui): hide only the top bar on tablet/desktop scroll, keep search#1238
BigSimmo merged 22 commits into
mainfrom
cursor/header-hide-top-bar-only-4fd7

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Tablet/desktop hide-on-scroll was hiding the search field with the mode/new-chat top bar. Root cause: the collapse/translate wrapper wrapped headerAndComposer (top bar + search). Phone docks escape via position: fixed; inline tablet/desktop search does not.

This PR collapses only header#search (plus optional Therapy phone nav addon). Search stays a sibling. Sticky hosts pin an outer [top bar | search] stack below the always-on chrome-safe-area-top spacer without translating the search away.

Also fixed while landing CI

  • Sticky-stack composers stay relative in the outer stack (no second sticky / no bare fixed cascade fight that overlays Services rail controls).
  • Services decision-rail testids + center scrollIntoView so Playwright does not park rail clicks under the pinned search band.
  • Desktop composer placement checks accept a sticky ancestor (outer stack), not only position: sticky on the form.
  • Merged latest main safe-area spacer + submitted-result focus rules without restoring whole-stack translate hide.
  • Therapy phone-nav hide assert updated for collapse host sitting below chrome-safe-area-top.

Verification

  • npx vitest run tests/header-scroll-hide-contract.test.ts (14/14)
  • Playwright chromium: services decision rail + desktop composer placement (6/6)
  • Playwright chromium: ui-chrome-scroll (12/12) on pre-merge tip; Therapy nav rechecked after safe-area merge
  • Hosted Production UI passed on fix tip 12a21258 (288+ tests; earlier tip)
  • Hosted CI on tip fdc20bfe (Therapy nav assert fix)

RAG impact

RAG impact: no retrieval behaviour change — UI chrome / search placement only.

Risk

UI chrome only. Watch tablet/desktop: top bar hides, search stays, status-bar safe-area never releases, Services rail remains clickable under the sticky search band.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Therapy Compass navigation now moves with the universal top bar on phones, hiding and reappearing consistently during scrolling.
    • Tablet and desktop search remains visible while the top bar collapses.
  • Bug Fixes

    • Improved sticky, collapse, safe-area, and spacing behavior across responsive layouts.
    • Preserved service comparison and review controls while improving their accessibility and interaction behavior.
  • Tests

    • Expanded coverage for responsive header behavior, Therapy navigation scrolling, search visibility, and service actions.

BigSimmo added 4 commits July 26, 2026 03:50
Anchor the Therapy secondary strip inside universal-header-collapse so it
hides and reveals with the top bar on the shared scroll signal. Desktop
keeps the in-flow sticky nav in the workspace.
Document the header-collapse addon rule and lock the phone portal wiring
with static contracts plus a Chromium hide/reveal check.
The prior chrome-scroll suite only checked data-scroll-hidden on forms, so
wrapping the search composer inside the collapse row could still go green.
Assert header-band search geometry stays on screen, and register the Therapy
nav scroll spec in the production Playwright matcher.
@supabase

supabase Bot commented Jul 25, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e590fe40-9458-4030-99dc-22f73c2b5ca6

📥 Commits

Reviewing files that changed from the base of the PR and between 8004a2e and db4390b.

📒 Files selected for processing (16)
  • docs/branch-review-ledger.md
  • docs/search-chrome-behaviour.md
  • playwright.config.ts
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/services/services-navigator-page.tsx
  • src/components/therapy-compass/nav.tsx
  • src/components/therapy-compass/therapy-compass.css
  • src/lib/mode-home-composer.ts
  • tests/header-scroll-hide-contract.test.ts
  • tests/therapy-compass-responsive-contract.test.ts
  • tests/ui-chrome-scroll.spec.ts
  • tests/ui-route-coverage.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-therapy-nav-scroll.spec.ts
  • tests/ui-tools.spec.ts

📝 Walkthrough

Walkthrough

The PR separates the collapsing top bar from the search composer, portals Therapy section navigation into the phone collapse host, updates responsive styling and routing, and expands contract, Playwright, smoke, and production test selection coverage.

Changes

Responsive header collapse

Layer / File(s) Summary
Header composition and collapse contracts
src/components/clinical-dashboard/master-search-header.tsx, src/components/clinical-dashboard/global-search-shell.tsx, src/lib/mode-home-composer.ts, docs/search-chrome-behaviour.md, tests/header-scroll-hide-contract.test.ts, docs/branch-review-ledger.md
The collapsing top bar is rendered separately from the search composer, with Therapy routes receiving an optional collapse addon slot and updated cross-breakpoint contracts.
Therapy phone navigation portal
src/components/therapy-compass/nav.tsx, src/components/therapy-compass/therapy-compass.css, tests/therapy-compass-responsive-contract.test.ts, tests/ui-route-coverage.spec.ts, tests/ui-therapy-nav-scroll.spec.ts
Therapy navigation is portaled into the phone collapse host and rendered with non-sticky positioning there; responsive and scroll behavior are tested.
Scroll behavior validation and test selection
tests/ui-chrome-scroll.spec.ts, tests/ui-tools.spec.ts, playwright.config.ts
UI tests verify search visibility and sticky ancestry across breakpoints, while production matching includes the expanded UI spec set.
Services decision-rail test hooks
src/components/services/services-navigator-page.tsx, tests/ui-smoke.spec.ts
Decision-rail controls gain stable selectors, accessibility text, and updated smoke-test interactions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MainContent
  participant UniversalHeaderCollapse
  participant TherapyCompassNav
  User->>MainContent: scroll therapy results
  MainContent->>UniversalHeaderCollapse: update data-scroll-hidden
  UniversalHeaderCollapse->>TherapyCompassNav: hide or reveal collapse host
  TherapyCompassNav-->>User: show section navigation when header returns
Loading

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude, cursoragent

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/header-hide-top-bar-only-4fd7

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Production UIneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #5757 (success).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

BigSimmo and others added 12 commits July 26, 2026 04:30
Phone section nav portals outside .tc-root into the header collapse host,
so closest(.tc-root) was empty. Read the workspace root from the document
and assert the strip is anchored under universal-header-collapse.
Sticky-stack hosts already pin [top bar | search]; a second sticky composer
with its own top offset overlays page controls once the top bar collapses.
Keep that composer in normal flow inside the outer stack. Also target the
decision-rail Clear by title and re-query Compare after RightRail remounts.
A bare ixed class on the composer survived beside sm:relative under
Tailwind's cascade, so GlobalSearchShell search kept overlaying page
controls (Services Clear/Compare). Scope fixed to max-sm when the outer
sticky stack owns tablet/desktop placement, and assert Compare by title.
Keep sticky-stack composers in normal flow (relative), harden Services rail
testids/scroll-into-view for the pinned search band, and accept sticky
ancestors in desktop composer placement checks.
Document the Services-rail click hazard under the pinned sticky-stack
search band and keep the header scroll contract aligned.
Keep top-bar-only collapse + sticky search stack while adopting main's
always-on chrome-safe-area-top spacer and submitted-result focus rules.
Collapsed chrome now sits below chrome-safe-area-top, so the phone nav
off-screen check must use the collapse host top rather than viewport y=0.
@BigSimmo
BigSimmo marked this pull request as ready for review July 25, 2026 22:39
@BigSimmo
BigSimmo enabled auto-merge (squash) July 25, 2026 22:39
@BigSimmo
BigSimmo merged commit cdbe0e6 into main Jul 25, 2026
19 checks passed
@BigSimmo
BigSimmo deleted the cursor/header-hide-top-bar-only-4fd7 branch July 25, 2026 22:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db4390b381

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


// Phones: portal into the collapsing top-bar track so the strip hides/reveals
// with the universal header. sm+: keep in-flow sticky inside the workspace.
if (phoneHost) return createPortal(navShell, phoneHost);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Therapy nav styles after portaling

On phone widths, this portals the section nav into a header host outside .tc-root, but its layout rules remain scoped as .tc-root .tc-nav-001, .tc-root .tc-nav-007, and .tc-root .tc-btn; the added portal-specific CSS only overrides position, top, and z-index. Consequently the phone nav loses its flex centering, padding/background, horizontal scrolling, and scoped focus/interaction styles, so the seven controls can wrap or overflow instead of remaining a compact scrollable strip. A focused browser check of the portaled nav's computed display, overflow-x, padding, and background at 390px would catch this; either preserve the .tc-root scope at the portal destination or duplicate the applicable scoped rules for the portal host.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent Resolve comment

BigSimmo added a commit that referenced this pull request Jul 25, 2026
Append-only ledger closeout after #1238 landed.

RAG impact: no retrieval behaviour change — ledger docs only.
BigSimmo added a commit that referenced this pull request Jul 26, 2026
Resolve search-chrome conflicts by keeping main's sticky-stack top-bar
hide behaviour from #1238/#1234, which supersedes the page-anchored
composer approach on this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
cursor Bot pushed a commit that referenced this pull request Jul 26, 2026
GitHub CONFLICTING on #1241 was staleness. Merged origin/main cleanly;
removed two exact-duplicate #1238 rows re-appended by the ledger union
driver and recorded the sync.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant